<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script>
        var isPalindrome = function(s) {
            if(s === '') return true;
            let newStr = s.replace(/[^a-zA-Z]/g, '').toLowerCase();
            let reStr = Array.from(newStr).reverse().toString().replace(/,/g, '');
            console.log(newStr); // raceacar
            console.log(reStr); //racaecar
            return  newStr === reStr;
        };
        console.log(isPalindrome("0P"))
    </script>
</body>
</html>
